package com.example.qjsandroid;

import android.os.Bundle;
import android.util.Log;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;



public class MainActivity extends AppCompatActivity {

    static {
        System.loadLibrary("quickjs");
        System.loadLibrary("quickjs_wrapper");
    }

    public native String executeQuickJS(String jsCode);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String jsCode = "const hello = 'Hello, QuickJS!'; hello;";
        String result = executeQuickJS(jsCode);

        Log.d("QuickJS", "Result: " + result);
    }
}